<?php

abstract class Controller_Base extends Controller_Template
{
	public function before()
	{
		parent::before();
		
		if($this->auto_render)
		{
			$this->template->content = '';
			$this->template->title = array();
		}
	}
	
	public function after()
	{
		$this->template->title = (! empty($this->template->title)) ? ' - '.implode(' - ', $this->template->title) : NULL;
		
		$this->template->menu = Kohana::config('site.menu');
		
		$tidy_config = array (
			'indent' => TRUE,
			'indent-spaces' => 3,
			'indent-attributes' => 'auto',
			'output-xhtml' => TRUE,
			'wrap' => 0,
			//'doctype' => 'strict',
			'alt-text' => '',
			'hide-comments' => TRUE,
			'output-bom' => FALSE
			//'logical-emphasis' => TRUE
		);
			
		$this->template = tidy_repair_string($this->template, $tidy_config, 'utf8');
		
		
		parent::after();
	}
}